package cn.itliuliu.org.domain;

import cn.itliuliu.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;

/**
 * 部门
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    //部门编号
    @NotEmpty(message = "部门编号不可为空")
    private String sn;
    //部门名称
    @ApiModelProperty("部门名称")
    @NotEmpty(message = "部门名称不可为空")
    private String name;
    //上级分类id
    private String dirPath;
    //部门状态，0正常，1禁用
    @ApiModelProperty("部门状态，0正常，1禁用")
    private Integer state;

    //员工对象
    private Employee manager;
    //部门管理员id
    private Long manager_id;

    //上级部门
    private Department parent;
    //上级部门id
    private Long parent_id;

    //子级部门
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();

}
